<template>
    <!-- p62    6:23 -->
    <!-- 
        title 弹框标题
        visible 是否显示 Dialog, 支持 .sync 修饰符 boolean -   false

     -->
    <el-dialog :title="title" :visible="dialogVisible" width="35%" >
        <strong>请输入类目名称:</strong>
        <el-input v-model="input" placeholder="请输入内容"></el-input>
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="submitHandle">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
export default {
    props: ['title','type'],
    data(){
        return{
            dialogVisible:false,
            input:''
        }
    },
    methods:{
        submitHandle(){
            //新增分类
            if(this.type==1){
                console.log('新增',this.input);
            }else{
                console.log('修改',this.input);
            }
        }
    }
}
</script>

<style>

</style>